home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14441 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: noc.tor.hookup.net!news
  2. From: Richard Steadman <rsteadma@micromedia.on.ca>
  3. Newsgroups: comp.lang.c
  4. Subject: Q: "Overlapping Objects"
  5. Date: Sun, 14 Apr 1996 14:22:56 -0400
  6. Organization: Micromedia
  7. Message-ID: <31714280.201A@micromedia.on.ca>
  8. NNTP-Posting-Host: keeper.mmltd.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. Hello.
  15.  
  16. I have a question which is quite simple, but I can't seem to find
  17. the right answer anywhere.
  18.  
  19. I'm trying to figure out when it is necessary to use the memmove()
  20. function when copying strings. K&R and the man page says to use it
  21. when the "objects overlap". But I can't find a formal definition
  22. for this phrase (it's not in the FAQ either -- I checked!).
  23.  
  24. Here's the scenario: I have a string, and want to copy the tail of
  25. it to an earlier part of the string. The two pieces are *not* 
  26. overlappng when the function is called, but they may be when the 
  27. copy is finished.
  28.  
  29. Given this, it safe to use strcat() instead of memmove()?
  30.  
  31. Thanks,
  32.  
  33. Richard Steadman
  34. rsteadma@mmltd.com
  35.  
  36.